3.165 \(\int (a+b \log (c x^n))^2 (d+e \log (f x^r)) \, dx\)

Optimal. Leaf size=147 \[ x \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right )-e r x \left (a+b \log \left (c x^n\right )\right )^2-2 a b n x \left (d+e \log \left (f x^r\right )\right )+2 a b e n r x+2 b e n r x (a-b n)-2 b^2 n x \log \left (c x^n\right ) \left (d+e \log \left (f x^r\right )\right )+4 b^2 e n r x \log \left (c x^n\right )+2 b^2 n^2 x \left (d+e \log \left (f x^r\right )\right )-4 b^2 e n^2 r x \]

[Out]

2*a*b*e*n*r*x - 4*b^2*e*n^2*r*x + 2*b*e*n*(a - b*n)*r*x + 4*b^2*e*n*r*x*Log[c*x^n] - e*r*x*(a + b*Log[c*x^n])^
2 - 2*a*b*n*x*(d + e*Log[f*x^r]) + 2*b^2*n^2*x*(d + e*Log[f*x^r]) - 2*b^2*n*x*Log[c*x^n]*(d + e*Log[f*x^r]) +
x*(a + b*Log[c*x^n])^2*(d + e*Log[f*x^r])

________________________________________________________________________________________

Rubi [A]  time = 0.0881252, antiderivative size = 147, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {2296, 2295, 2361} \[ x \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right )-e r x \left (a+b \log \left (c x^n\right )\right )^2-2 a b n x \left (d+e \log \left (f x^r\right )\right )+2 a b e n r x+2 b e n r x (a-b n)-2 b^2 n x \log \left (c x^n\right ) \left (d+e \log \left (f x^r\right )\right )+4 b^2 e n r x \log \left (c x^n\right )+2 b^2 n^2 x \left (d+e \log \left (f x^r\right )\right )-4 b^2 e n^2 r x \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Log[c*x^n])^2*(d + e*Log[f*x^r]),x]

[Out]

2*a*b*e*n*r*x - 4*b^2*e*n^2*r*x + 2*b*e*n*(a - b*n)*r*x + 4*b^2*e*n*r*x*Log[c*x^n] - e*r*x*(a + b*Log[c*x^n])^
2 - 2*a*b*n*x*(d + e*Log[f*x^r]) + 2*b^2*n^2*x*(d + e*Log[f*x^r]) - 2*b^2*n*x*Log[c*x^n]*(d + e*Log[f*x^r]) +
x*(a + b*Log[c*x^n])^2*(d + e*Log[f*x^r])

Rule 2296

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2361

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.) + Log[(f_.)*(x_)^(r_.)]*(e_.)), x_Symbol] :> With[{u =
IntHide[(a + b*Log[c*x^n])^p, x]}, Dist[d + e*Log[f*x^r], u, x] - Dist[e*r, Int[SimplifyIntegrand[u/x, x], x],
 x]] /; FreeQ[{a, b, c, d, e, f, n, p, r}, x]

Rubi steps

\begin{align*} \int \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right ) \, dx &=-2 a b n x \left (d+e \log \left (f x^r\right )\right )+2 b^2 n^2 x \left (d+e \log \left (f x^r\right )\right )-2 b^2 n x \log \left (c x^n\right ) \left (d+e \log \left (f x^r\right )\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right )-(e r) \int \left (-2 a b n+2 b^2 n^2-2 b^2 n \log \left (c x^n\right )+\left (a+b \log \left (c x^n\right )\right )^2\right ) \, dx\\ &=2 b e n (a-b n) r x-2 a b n x \left (d+e \log \left (f x^r\right )\right )+2 b^2 n^2 x \left (d+e \log \left (f x^r\right )\right )-2 b^2 n x \log \left (c x^n\right ) \left (d+e \log \left (f x^r\right )\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right )-(e r) \int \left (a+b \log \left (c x^n\right )\right )^2 \, dx+\left (2 b^2 e n r\right ) \int \log \left (c x^n\right ) \, dx\\ &=-2 b^2 e n^2 r x+2 b e n (a-b n) r x+2 b^2 e n r x \log \left (c x^n\right )-e r x \left (a+b \log \left (c x^n\right )\right )^2-2 a b n x \left (d+e \log \left (f x^r\right )\right )+2 b^2 n^2 x \left (d+e \log \left (f x^r\right )\right )-2 b^2 n x \log \left (c x^n\right ) \left (d+e \log \left (f x^r\right )\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right )+(2 b e n r) \int \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=2 a b e n r x-2 b^2 e n^2 r x+2 b e n (a-b n) r x+2 b^2 e n r x \log \left (c x^n\right )-e r x \left (a+b \log \left (c x^n\right )\right )^2-2 a b n x \left (d+e \log \left (f x^r\right )\right )+2 b^2 n^2 x \left (d+e \log \left (f x^r\right )\right )-2 b^2 n x \log \left (c x^n\right ) \left (d+e \log \left (f x^r\right )\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right )+\left (2 b^2 e n r\right ) \int \log \left (c x^n\right ) \, dx\\ &=2 a b e n r x-4 b^2 e n^2 r x+2 b e n (a-b n) r x+4 b^2 e n r x \log \left (c x^n\right )-e r x \left (a+b \log \left (c x^n\right )\right )^2-2 a b n x \left (d+e \log \left (f x^r\right )\right )+2 b^2 n^2 x \left (d+e \log \left (f x^r\right )\right )-2 b^2 n x \log \left (c x^n\right ) \left (d+e \log \left (f x^r\right )\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \left (d+e \log \left (f x^r\right )\right )\\ \end{align*}

Mathematica [A]  time = 0.10441, size = 141, normalized size = 0.96 \[ x \left (e \left (a^2-2 a b n+2 b^2 n^2\right ) \log \left (f x^r\right )+a^2 d-a^2 e r+2 b \log \left (c x^n\right ) \left (e (a-b n) \log \left (f x^r\right )+a d-a e r-b d n+2 b e n r\right )-2 a b d n+4 a b e n r+b^2 \log ^2\left (c x^n\right ) \left (d+e \log \left (f x^r\right )-e r\right )+2 b^2 d n^2-6 b^2 e n^2 r\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Log[c*x^n])^2*(d + e*Log[f*x^r]),x]

[Out]

x*(a^2*d - 2*a*b*d*n + 2*b^2*d*n^2 - a^2*e*r + 4*a*b*e*n*r - 6*b^2*e*n^2*r + e*(a^2 - 2*a*b*n + 2*b^2*n^2)*Log
[f*x^r] + b^2*Log[c*x^n]^2*(d - e*r + e*Log[f*x^r]) + 2*b*Log[c*x^n]*(a*d - b*d*n - a*e*r + 2*b*e*n*r + e*(a -
 b*n)*Log[f*x^r]))

________________________________________________________________________________________

Maple [C]  time = 0.5, size = 8701, normalized size = 59.2 \begin{align*} \text{output too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*ln(c*x^n))^2*(d+e*ln(f*x^r)),x)

[Out]

result too large to display

________________________________________________________________________________________

Maxima [A]  time = 1.19807, size = 288, normalized size = 1.96 \begin{align*} -{\left (r x - x \log \left (f x^{r}\right )\right )} b^{2} e \log \left (c x^{n}\right )^{2} + b^{2} d x \log \left (c x^{n}\right )^{2} + 2 \,{\left ({\left (2 \, r - \log \left (f\right )\right )} x - x \log \left (x^{r}\right )\right )} a b e n - 2 \, a b d n x - a^{2} e r x - 2 \,{\left (r x - x \log \left (f x^{r}\right )\right )} a b e \log \left (c x^{n}\right ) + 2 \, a b d x \log \left (c x^{n}\right ) + a^{2} e x \log \left (f x^{r}\right ) + 2 \,{\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} b^{2} d - 2 \,{\left ({\left ({\left (3 \, r - \log \left (f\right )\right )} x - x \log \left (x^{r}\right )\right )} n^{2} -{\left ({\left (2 \, r - \log \left (f\right )\right )} x - x \log \left (x^{r}\right )\right )} n \log \left (c x^{n}\right )\right )} b^{2} e + a^{2} d x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2*(d+e*log(f*x^r)),x, algorithm="maxima")

[Out]

-(r*x - x*log(f*x^r))*b^2*e*log(c*x^n)^2 + b^2*d*x*log(c*x^n)^2 + 2*((2*r - log(f))*x - x*log(x^r))*a*b*e*n -
2*a*b*d*n*x - a^2*e*r*x - 2*(r*x - x*log(f*x^r))*a*b*e*log(c*x^n) + 2*a*b*d*x*log(c*x^n) + a^2*e*x*log(f*x^r)
+ 2*(n^2*x - n*x*log(c*x^n))*b^2*d - 2*(((3*r - log(f))*x - x*log(x^r))*n^2 - ((2*r - log(f))*x - x*log(x^r))*
n*log(c*x^n))*b^2*e + a^2*d*x

________________________________________________________________________________________

Fricas [B]  time = 0.834739, size = 790, normalized size = 5.37 \begin{align*} b^{2} e n^{2} r x \log \left (x\right )^{3} -{\left (b^{2} e r - b^{2} d\right )} x \log \left (c\right )^{2} - 2 \,{\left (b^{2} d n - a b d -{\left (2 \, b^{2} e n - a b e\right )} r\right )} x \log \left (c\right ) +{\left (2 \, b^{2} e n r x \log \left (c\right ) + b^{2} e n^{2} x \log \left (f\right ) +{\left (b^{2} d n^{2} -{\left (3 \, b^{2} e n^{2} - 2 \, a b e n\right )} r\right )} x\right )} \log \left (x\right )^{2} +{\left (2 \, b^{2} d n^{2} - 2 \, a b d n + a^{2} d -{\left (6 \, b^{2} e n^{2} - 4 \, a b e n + a^{2} e\right )} r\right )} x +{\left (b^{2} e x \log \left (c\right )^{2} - 2 \,{\left (b^{2} e n - a b e\right )} x \log \left (c\right ) +{\left (2 \, b^{2} e n^{2} - 2 \, a b e n + a^{2} e\right )} x\right )} \log \left (f\right ) +{\left (b^{2} e r x \log \left (c\right )^{2} + 2 \,{\left (b^{2} d n -{\left (2 \, b^{2} e n - a b e\right )} r\right )} x \log \left (c\right ) -{\left (2 \, b^{2} d n^{2} - 2 \, a b d n -{\left (6 \, b^{2} e n^{2} - 4 \, a b e n + a^{2} e\right )} r\right )} x + 2 \,{\left (b^{2} e n x \log \left (c\right ) -{\left (b^{2} e n^{2} - a b e n\right )} x\right )} \log \left (f\right )\right )} \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2*(d+e*log(f*x^r)),x, algorithm="fricas")

[Out]

b^2*e*n^2*r*x*log(x)^3 - (b^2*e*r - b^2*d)*x*log(c)^2 - 2*(b^2*d*n - a*b*d - (2*b^2*e*n - a*b*e)*r)*x*log(c) +
 (2*b^2*e*n*r*x*log(c) + b^2*e*n^2*x*log(f) + (b^2*d*n^2 - (3*b^2*e*n^2 - 2*a*b*e*n)*r)*x)*log(x)^2 + (2*b^2*d
*n^2 - 2*a*b*d*n + a^2*d - (6*b^2*e*n^2 - 4*a*b*e*n + a^2*e)*r)*x + (b^2*e*x*log(c)^2 - 2*(b^2*e*n - a*b*e)*x*
log(c) + (2*b^2*e*n^2 - 2*a*b*e*n + a^2*e)*x)*log(f) + (b^2*e*r*x*log(c)^2 + 2*(b^2*d*n - (2*b^2*e*n - a*b*e)*
r)*x*log(c) - (2*b^2*d*n^2 - 2*a*b*d*n - (6*b^2*e*n^2 - 4*a*b*e*n + a^2*e)*r)*x + 2*(b^2*e*n*x*log(c) - (b^2*e
*n^2 - a*b*e*n)*x)*log(f))*log(x)

________________________________________________________________________________________

Sympy [B]  time = 13.1492, size = 534, normalized size = 3.63 \begin{align*} a^{2} d x + a^{2} e r x \log{\left (x \right )} - a^{2} e r x + a^{2} e x \log{\left (f \right )} + 2 a b d n x \log{\left (x \right )} - 2 a b d n x + 2 a b d x \log{\left (c \right )} + 2 a b e n r x \log{\left (x \right )}^{2} - 4 a b e n r x \log{\left (x \right )} + 4 a b e n r x + 2 a b e n x \log{\left (f \right )} \log{\left (x \right )} - 2 a b e n x \log{\left (f \right )} + 2 a b e r x \log{\left (c \right )} \log{\left (x \right )} - 2 a b e r x \log{\left (c \right )} + 2 a b e x \log{\left (c \right )} \log{\left (f \right )} + b^{2} d n^{2} x \log{\left (x \right )}^{2} - 2 b^{2} d n^{2} x \log{\left (x \right )} + 2 b^{2} d n^{2} x + 2 b^{2} d n x \log{\left (c \right )} \log{\left (x \right )} - 2 b^{2} d n x \log{\left (c \right )} + b^{2} d x \log{\left (c \right )}^{2} + b^{2} e n^{2} r x \log{\left (x \right )}^{3} - 3 b^{2} e n^{2} r x \log{\left (x \right )}^{2} + 6 b^{2} e n^{2} r x \log{\left (x \right )} - 6 b^{2} e n^{2} r x + b^{2} e n^{2} x \log{\left (f \right )} \log{\left (x \right )}^{2} - 2 b^{2} e n^{2} x \log{\left (f \right )} \log{\left (x \right )} + 2 b^{2} e n^{2} x \log{\left (f \right )} + 2 b^{2} e n r x \log{\left (c \right )} \log{\left (x \right )}^{2} - 4 b^{2} e n r x \log{\left (c \right )} \log{\left (x \right )} + 4 b^{2} e n r x \log{\left (c \right )} + 2 b^{2} e n x \log{\left (c \right )} \log{\left (f \right )} \log{\left (x \right )} - 2 b^{2} e n x \log{\left (c \right )} \log{\left (f \right )} + b^{2} e r x \log{\left (c \right )}^{2} \log{\left (x \right )} - b^{2} e r x \log{\left (c \right )}^{2} + b^{2} e x \log{\left (c \right )}^{2} \log{\left (f \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*ln(c*x**n))**2*(d+e*ln(f*x**r)),x)

[Out]

a**2*d*x + a**2*e*r*x*log(x) - a**2*e*r*x + a**2*e*x*log(f) + 2*a*b*d*n*x*log(x) - 2*a*b*d*n*x + 2*a*b*d*x*log
(c) + 2*a*b*e*n*r*x*log(x)**2 - 4*a*b*e*n*r*x*log(x) + 4*a*b*e*n*r*x + 2*a*b*e*n*x*log(f)*log(x) - 2*a*b*e*n*x
*log(f) + 2*a*b*e*r*x*log(c)*log(x) - 2*a*b*e*r*x*log(c) + 2*a*b*e*x*log(c)*log(f) + b**2*d*n**2*x*log(x)**2 -
 2*b**2*d*n**2*x*log(x) + 2*b**2*d*n**2*x + 2*b**2*d*n*x*log(c)*log(x) - 2*b**2*d*n*x*log(c) + b**2*d*x*log(c)
**2 + b**2*e*n**2*r*x*log(x)**3 - 3*b**2*e*n**2*r*x*log(x)**2 + 6*b**2*e*n**2*r*x*log(x) - 6*b**2*e*n**2*r*x +
 b**2*e*n**2*x*log(f)*log(x)**2 - 2*b**2*e*n**2*x*log(f)*log(x) + 2*b**2*e*n**2*x*log(f) + 2*b**2*e*n*r*x*log(
c)*log(x)**2 - 4*b**2*e*n*r*x*log(c)*log(x) + 4*b**2*e*n*r*x*log(c) + 2*b**2*e*n*x*log(c)*log(f)*log(x) - 2*b*
*2*e*n*x*log(c)*log(f) + b**2*e*r*x*log(c)**2*log(x) - b**2*e*r*x*log(c)**2 + b**2*e*x*log(c)**2*log(f)

________________________________________________________________________________________

Giac [B]  time = 1.33034, size = 574, normalized size = 3.9 \begin{align*} b^{2} n^{2} r x e \log \left (x\right )^{3} - 3 \, b^{2} n^{2} r x e \log \left (x\right )^{2} + 2 \, b^{2} n r x e \log \left (c\right ) \log \left (x\right )^{2} + b^{2} n^{2} x e \log \left (f\right ) \log \left (x\right )^{2} + 6 \, b^{2} n^{2} r x e \log \left (x\right ) - 4 \, b^{2} n r x e \log \left (c\right ) \log \left (x\right ) + b^{2} r x e \log \left (c\right )^{2} \log \left (x\right ) - 2 \, b^{2} n^{2} x e \log \left (f\right ) \log \left (x\right ) + 2 \, b^{2} n x e \log \left (c\right ) \log \left (f\right ) \log \left (x\right ) + b^{2} d n^{2} x \log \left (x\right )^{2} + 2 \, a b n r x e \log \left (x\right )^{2} - 6 \, b^{2} n^{2} r x e + 4 \, b^{2} n r x e \log \left (c\right ) - b^{2} r x e \log \left (c\right )^{2} + 2 \, b^{2} n^{2} x e \log \left (f\right ) - 2 \, b^{2} n x e \log \left (c\right ) \log \left (f\right ) + b^{2} x e \log \left (c\right )^{2} \log \left (f\right ) - 2 \, b^{2} d n^{2} x \log \left (x\right ) - 4 \, a b n r x e \log \left (x\right ) + 2 \, b^{2} d n x \log \left (c\right ) \log \left (x\right ) + 2 \, a b r x e \log \left (c\right ) \log \left (x\right ) + 2 \, a b n x e \log \left (f\right ) \log \left (x\right ) + 2 \, b^{2} d n^{2} x + 4 \, a b n r x e - 2 \, b^{2} d n x \log \left (c\right ) - 2 \, a b r x e \log \left (c\right ) + b^{2} d x \log \left (c\right )^{2} - 2 \, a b n x e \log \left (f\right ) + 2 \, a b x e \log \left (c\right ) \log \left (f\right ) + 2 \, a b d n x \log \left (x\right ) + a^{2} r x e \log \left (x\right ) - 2 \, a b d n x - a^{2} r x e + 2 \, a b d x \log \left (c\right ) + a^{2} x e \log \left (f\right ) + a^{2} d x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2*(d+e*log(f*x^r)),x, algorithm="giac")

[Out]

b^2*n^2*r*x*e*log(x)^3 - 3*b^2*n^2*r*x*e*log(x)^2 + 2*b^2*n*r*x*e*log(c)*log(x)^2 + b^2*n^2*x*e*log(f)*log(x)^
2 + 6*b^2*n^2*r*x*e*log(x) - 4*b^2*n*r*x*e*log(c)*log(x) + b^2*r*x*e*log(c)^2*log(x) - 2*b^2*n^2*x*e*log(f)*lo
g(x) + 2*b^2*n*x*e*log(c)*log(f)*log(x) + b^2*d*n^2*x*log(x)^2 + 2*a*b*n*r*x*e*log(x)^2 - 6*b^2*n^2*r*x*e + 4*
b^2*n*r*x*e*log(c) - b^2*r*x*e*log(c)^2 + 2*b^2*n^2*x*e*log(f) - 2*b^2*n*x*e*log(c)*log(f) + b^2*x*e*log(c)^2*
log(f) - 2*b^2*d*n^2*x*log(x) - 4*a*b*n*r*x*e*log(x) + 2*b^2*d*n*x*log(c)*log(x) + 2*a*b*r*x*e*log(c)*log(x) +
 2*a*b*n*x*e*log(f)*log(x) + 2*b^2*d*n^2*x + 4*a*b*n*r*x*e - 2*b^2*d*n*x*log(c) - 2*a*b*r*x*e*log(c) + b^2*d*x
*log(c)^2 - 2*a*b*n*x*e*log(f) + 2*a*b*x*e*log(c)*log(f) + 2*a*b*d*n*x*log(x) + a^2*r*x*e*log(x) - 2*a*b*d*n*x
 - a^2*r*x*e + 2*a*b*d*x*log(c) + a^2*x*e*log(f) + a^2*d*x